package com.tonyodev.fetch2fileserver.provider;

import com.tonyodev.fetch2core.Extras;
import com.tonyodev.fetch2core.FileResource;
import com.tonyodev.fetch2core.InputResourceWrapper;
import com.tonyodev.fetch2core.InterruptMonitor;
import com.tonyodev.fetch2core.server.FileRequest;
import com.tonyodev.fetch2core.server.FileResourceTransporterWriter;

public interface FileResourceProviderDelegate {

    FileResource getFileResource(String fileResourceIdentifier);

    void onFinished(String providerId);

    boolean acceptAuthorization(String sessionId, String authorization, FileRequest fileRequest);

    void onClientDidProvideExtras(String sessionId, Extras extras, FileRequest fileRequest);

    void onClientConnected(String sessionId, FileRequest fileRequest);

    void onClientDisconnected(String sessionId, FileRequest fileRequest);

    void onStarted(String sessionId, FileRequest fileRequest, FileResource fileResource);

    void onProgress(String sessionId, FileRequest fileRequest, FileResource fileResource, int progress);

    void onComplete(String sessionId, FileRequest fileRequest, FileResource fileResource);

    void onError(String sessionId, FileRequest fileRequest, FileResource fileResource, Throwable throwable);

    String  getCatalog(int page, int size);

    InputResourceWrapper getFileInputResourceWrapper(String sessionId, FileRequest fileRequest, FileResource fileResource, long fileOffset);

    void onCustomRequest(String sessionId, FileRequest fileRequest, FileResourceTransporterWriter fileResourceTransporterWriter, InterruptMonitor interruptMonitor);
}
